<template>
  <div>
    <h5>视频组件，采用西瓜播放器</h5>
    <div id="video" />
  </div>
</template>
<script>
import Player from 'xgplayer/dist/simple_player';
import volume from 'xgplayer/dist/controls/volume';
import playbackRate from 'xgplayer/dist/controls/playbackRate';
export default {
  data() {
    return {};
  },
  mounted() {
    new Player({
      id: 'video',
      // 默认音量
      volume: 0.6,
      autoplay: false,
      width: 300,
      height: 250,
      screenShot: true,
      url: 'https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/mp4/xgplayer-demo-720p.mp4',
      poster: 'https://s2.pstatp.com/cdn/expire-1-M/byted-player-videos/1.0.0/poster.jpg',
      controlPlugins: [volume, playbackRate],
      // 传入倍速可选数组
      playbackRate: [0.5, 0.75, 1, 1.5, 2]
    });
  },
  methods: {}
};
</script>
<style scoped>
html,
body {
  width: 100%;
  height: 100%;
  margin: auto;
  overflow: hidden;
}
h5 {
  font-size: 14px;
  font-weight: normal;
}
</style>
